1. Field of the Invention
The present invention relates to an encoding apparatus and method, a decoding apparatus and method, and an editing method which can preferably be used for effectively encoding, for example, a digital video signal and a digital audio signal, recording the signals on a recording medium such as a magneto-optical disc, editing, decoding and displaying the contents of the signals.
2. Description of the Related Art
In general, as a digital video signal has a quite large data amount, when recording a digital video signal for a long time on a recording medium having a small size recording medium having a small memory capacity, when transmitting a digital video signal through a communication route of a limited capacity with a plenty of channels, it is indispensable to effectively encode the digital video signal. In order to answer such a request, there have been suggested effective encoding systems utilizing a video signal correlation. One of such systems is the MPEG (Moving Picture Experts Group) system.
The MPEG system removes redundancy of the video signal in the time axis direction by using a difference between frames and then removes redundancy in the spatial axis direction by using an orthogonal conversion method such as the discrete cosine transform (DCT), thus enabling to effectively encode the video signal.
In the MPEG encoding, each of the frames is defined as an I picture, P picture or B picture for compressing a video signal. Moreover, in the MPEG system, in order to enable a random access reproduction (reproduction starting in a halfway) of the GOP (group of pictures) unit among the moving picture sequence, each GOP is added with a GOP start code as an identifier.
On the other hand, in the MPEG encoding system, a decoder detects a GOP start code of the GOP specified in the coding information (bit stream), so as to start decoding in that GOP, enabling to carryout reproduction in the middle of a moving picture sequence.
For example, as shown in FIGS. 1A and 1B, a video signal of nine frames from frame FO to F8 is defined as a GOP and each of the nine frames is encoded as an I picture, P picture, or B picture. The frames of I picture are encoded with their video data alone (intra coding) and transmitted. As for the frames of P picture, basically as shown in FIG. 1A, a frame of I picture of P picture which is preceding temporally is used as a prediction picture and a prediction residue signal is encoded and transmitted (forward predictive coding). Furthermore, a frame of B picture, basically as shown in FIG. 1B uses a reference frame in the past and a reference frame in the future as prediction pictures so that a prediction residue signal is coded and transmitted (bidirectional prediction coding). It should be noted that for the frames F0 and F1 which have no reference frame in the past, only the reference frames in the future are used as prediction frames so that a prediction residue signal is coded and transmitted (backward prediction coding).
If a moving picture signal coded in the GOP configuration is recorded on a recording medium such as an optical disc capable of random access, a user can select a start point of reproduction by the GOP unit. For example, as shown in FIG. 2, if a bit stream is assumed to consist of GOP-0 to GOP-(n+1), it is possible to random access to the n-th GOP (GOP-n) indicated by random_access in the figure and start reproduction at that point. As a representative application of this, there can be exemplified a video CD for recording a compressed video signal on a so-called compact disc (trade name) and a digital video disc (trade name: DVD) dedicated for read out.
Recently, an attention is paid on a writable disc medium of a large capacity such as a DVD-RAM. If a moving picture signal can be recorded on the DVD-RAM, in comparison to an application for recording a conventional magnetic tape medium, it becomes easier to carry out a random access reproduction and a skip reproduction as well as edition. Here, the aforementioned skip reproduction is a reproduction as shown in FIG. 3 which shows a coded information bit stream consisting of 0-th to m-th GOPs (GOP-0 to GOP-m), for which a reproduction is carried out while skipping a portion defined by the output point indicated by out-1 and the in point indicated by in-1 in the figure and a portion defined by an out point indicated by out-2 and an in point indicated by in-2 in the figure.
This skip reproduction is used in practice, for example, in the so-called MD (trade name: Mini Disc) for an audio data. According to this skip reproduction, a user can select a reproduction route on a frame (a predetermined number of sample data) basis from an audio signal recorded on the disc by the user. When reproduction is carried out in the selected route, it is possible to reproduce continuously (seamless) without causing a feeling of interruption to the user. In the case of audio MD, in order to realize a seamless skip reproduction, a track buffer memory is provided at a stage preceding an audio decoder, so that while an optical pickup is searching from an out point to an in point, i.e., while a data read out from the disc is halted, a data amount required to continue reproduction is read out in advance from the disc and is stored in the track buffer memory. Because in the MD all the frames of the audio signal coded with a high efficiency are coded with an identical bit amount, even if any route is selected, the track buffer memory will not underflow or overflow, enabling to carry out seamless reproduction.
On the other hand, for encoding a moving picture signal in the GOP configuration and recording it on an optical disc medium, there has been made no sufficient study on the method for realizing seamless skip reproduction.
That is, the coded bit amount of respective frames of a moving picture signal which has been coded with a high efficiency varies depending on the picture type I, P, and B as well as the picture contents. Consequently, when coding a moving picture signal, it is necessary to control the coded bit amount of the frames which are successively inputted, so as to allow underflow and overflow of the input buffer memory of a decoder. Here, if a skip reproduction with a reproduction route change causes a change of the input frame order to the input buffer memory of the decoder, there is a possibility that the input buffer memory of the decoder underflows or overflows.
For this, conventionally, when carrying out a skip reproduction, prior to reading out the GOP of the skip destination, the input buffer memory of the decoder is cleared off in advance and then read out of the GOP of the skip destination is carried out. However, in this method, a delay (start up delay) occurs before starting decoding of the GOP of the skip destination and it is impossible to realize a seamless video reproduction between the last frame of the skip start position and the first frame of the skip destination.
Moreover, as another example, in the aforementioned DVD-video, a creator (director) of the disc determines in advance the points at which the reproduction route can be changed, and a data is logically recorded on the disc so that skip reproduction can be carried out in seamless if the reproduction route is within this limit. Consequently, if the reproduction route is out of this limit defined by the director, there is no guarantee that a seamless picture reproduction can be obtained.